package com.zhiche.lisa.lspm.service.driver;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.IService;
import com.zhiche.lisa.lspm.dao.model.driver.DriverCarrierBind;

import java.util.List;

/**
 * <p>
 * 司机与车头绑定关系 服务类
 * </p>
 *
 * @author qichao
 * @since 2018-06-27
 */
public interface IDriverCarrierBindService extends IService<DriverCarrierBind> {

    /**
     * 绑定牵引车与挂车
     * @return
     */
    boolean bindDriverCarrier(Long carrierId, Long trailerId,Long tenantId);

    /**
     * 解绑牵引车与挂车
     * @return
     */
    boolean unbindDriverCarrier(Long carrierId, Long trailerId);

    /**
     * 得到非当前司机的牵引车绑定关系
     * @param carrierId
     * @return
     */
    DriverCarrierBind getCarrierBindByCarrierIdNoDriId(Long carrierId,Long driverId);

    /**
     * 根据司机得到绑定关系
     * @param driverId
     * @return
     */
    DriverCarrierBind getCarrierBindByDriverId(Long driverId);

    /**
     * 根据司机和牵引车得到绑定关系
     * @param carrierId
     * @return
     */
    DriverCarrierBind getCarrierBindByCarIdAndDriId(Long carrierId,Long driverId);

    List<DriverCarrierBind> selectListNoTenant(EntityWrapper<DriverCarrierBind> dcbEW);
}
